package com.ch.light.web.controller;

import com.ch.light.core.Response;
import com.ch.light.core.page.Page;
import com.ch.light.mybatis.ParamFilter;
import com.ch.light.web.aop.annotaion.WebLogger;
import com.ch.light.web.entity.User;
import com.ch.light.web.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;

@Controller
@RequestMapping("upload")
public class UploadController {

    @Resource
    private UserService userService;

    @GetMapping("listPage")
    public String list() {
        return "uploadList";
    }


    @ResponseBody
    @PostMapping("list")
    @WebLogger("查询用户列表")
    public Response list(@RequestBody  ParamFilter queryFilter) {
        List userList = userService.getList(queryFilter);
        Page page = queryFilter.getPage();
        return new Response(userList,page);
    }

}
